package com.demo.shardingsphere.supplier.config;


import org.apache.shardingsphere.api.sharding.ShardingValue;
import org.apache.shardingsphere.api.sharding.complex.ComplexKeysShardingAlgorithm;
import org.apache.shardingsphere.api.sharding.complex.ComplexKeysShardingValue;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;


/**
 * 复合列规则实现
 */
public class StaffTableComplexKeysShardingAlgorithm implements ComplexKeysShardingAlgorithm {


    @Override
    public Collection<String> doSharding(Collection collection, ComplexKeysShardingValue complexKeysShardingValue) {

        List<String> list = new ArrayList<>(4);
       /* ListShardingValue listShardingValue;
        for (ShardingValue item : shardingValues) {
            // 将item拆箱转换为listShardingValue
            listShardingValue = (ListShardingValue)item;
            System.out.println("逻辑表:" + listShardingValue.getLogicTableName());
            System.out.println("列名:" + listShardingValue.getColumnName());
            System.out.println("改列的值:" + listShardingValue.getValues());
        }*/

        return null;
    }
}